package com.song.andoperation;

/**
 *  @Title 判断一个数是否是2的n次幂
 *  @Autor Mr.Song
 */
public class AndOperation {
    public static void main(String[] args) {

        int[] a = new int[]{1,2,7,9,16,32,64,65,128};
        int count  = 0 ;
        for (int i : a ){
            if ((i & (i - 1)) == 0){
                System.out.println(i);
                System.out.println(++count);
                System.out.println("========");
            }
        }
    }
}
